package org.huatek.anders.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import org.springframework.data.annotation.Version;

import java.io.Serializable;
import java.util.Date;

/**
 * @author anders
 * @date 2018-12-06 10:56
 **/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class BaseEntity implements Serializable {

    private static final long serialVersionUID = 1751236854426726466L;
    @TableId(type = IdType.AUTO)
    protected Long id;
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    protected Date createTime;
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    protected Date updateTime;
    protected Long createUserId;
    protected Long updateUserId;
    protected Long sortNo;
    @TableLogic
    protected Boolean deleted;
    protected Boolean state;
    @Version
    protected int version;
}
